package org.jeecg.modules.job.ums.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.job.ums.entity.UmsShareLog;
import org.jeecg.modules.job.ums.entity.UmsShieldCompany;
import org.jeecg.modules.job.ums.mapper.UmsShieldCompanyMapper;
import org.jeecg.modules.job.ums.service.IUmsShieldCompanyService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 屏蔽公司
 * @Author: jeecg-boot
 * @Date:   2022-12-18
 * @Version: V1.0
 */
@Service
public class UmsShieldCompanyServiceImpl extends ServiceImpl<UmsShieldCompanyMapper, UmsShieldCompany> implements IUmsShieldCompanyService {

    @Override
    public boolean addOrUpdate(UmsShieldCompany param) {
        UmsShieldCompany result=this.getOne(new QueryWrapper<>(param));
        if (result!=null){
            param.setId(result.getId());
            return this.updateById(param);
        }else{
            return this.save(param);
        }
    }

    @Override
    public IPage<UmsShieldCompany> findPageBySpec(Page<UmsShieldCompany> page, UmsShieldCompany param) {
        return this.baseMapper.getShieldPageList(page,param);
    }
}
